package com.yax.mickey.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yax.mickey.entity.Product;
import com.yax.mickey.service.ProductService;
import com.yax.mickey.mapper.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author yax
* @description 针对表【product(商品信息表)】的数据库操作Service实现
* @createDate 2024-05-27 09:02:22
*/
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product>
    implements ProductService{

    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Product> getAllProducts() {
        return productMapper.getAllProducts();
    }

    @Override
    public Product getProductById(Integer productId) {
        return productMapper.getProductById(productId);
    }

    @Override
    public List<Product> getProductByCategoryId(Integer categoryId) {
        return productMapper.getProductByCategoryId(categoryId);
    }

    @Override
    public List<Product> getProductBySearch(String productName) {
        return productMapper.getProductBySearch(productName);
    }

}




